package ua.eug.airv1.map;

import ua.eug.airv1.utils.EDirection;
import ua.eug.airv1.utils.Vector2i;

public class TilePos extends Vector2i {

	public TilePos(int i, int j) {
		super(i,j);
	}

	public TilePos() {
		super();
	}

	// set coordinate of next hex tile
	public void nextHex(EDirection d) {
		if(y%2 == 1) {
			switch(d) {
			case N:
				y += 2;
				break;
			case NEE:
				x +=1;
				y += 1;
				break;
			case NWW:
				y += 1;
				break;
			case S:
				y -= 2;
				break;
			case SEE:
				x += 1;
				y -= 1;
				break;
			default:
				y -= 1;
				break;
			}
		} else {
			switch(d) {
			case N:
				y += 2;
				break;
			case NEE:
				y += 1;
				break;
			case NWW:
				x -= 1;
				y += 1;
				break;
			case S:
				y -= 2;
				break;
			case SEE:
				y -= 1;
				break;
			default:
				x -= 1;
				y -= 1;
				break;
			}
			
		}
	}

}
